/*
 * File:    VariableStoreHash.java
 * Created: 12-Feb-2009
 * Version: $Id$
 *
 * COPYRIGHT (C) 2009, Bitgate Mobile, LLC.  All Rights Reserved.
 *
 * software@bitgatemobile.com
 */

package com.webplasm.store;

import java.util.HashMap;
import java.util.Map;

import com.webplasm.store.VariableContainer.VariableType;

/**
 * This implements a hashmap store in Webplasm that stores variables of any type accepted by the
 * <code>VariableStoreInterface</code>.  This way, strings, integers, and even SQL persistent data can be stored
 * in the hashmap and traversed by the &lt;u:get&gt; tag.
 * 
 * @author kenji
 * @since Webplasm 2.0
 */
public class VariableStoreHash extends AbstractVariableStore {
	private Map<String, VariableStoreInterface> hashMap;
	
	public VariableStoreHash() {
		hashMap = new HashMap<String, VariableStoreInterface>();
	}
	
	public VariableType getType() {
		return VariableType.MAP;
	}
	
	@Override
	public Map<String, VariableStoreInterface> getMap() {
		return hashMap;
	}
	
	@Override
	public boolean isMappable() {
		return true;
	}
	
	@Override
	public Object getObject() {
		return hashMap;
	}
}
